// components/cardBig/cardBig.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    data:Object

  },

  /**
   * 组件的初始数据
   */
  data: {
    checked:false

  },

  /**
   * 组件的方法列表
   */
  methods: {
    todetail(e){
      console.log(e);
      let id = e.currentTarget.dataset.id
      wx.request({
        url: 'https://apis.netstart.cn/bcomic/ComicDetail',
        data:{
          'comicId':id
        },
        success:(res)=>{
          if(res.statusCode == 200){
            console.log(res);
            let dt = res.data.data;
            const data = JSON.stringify(dt)
            this.pageRouter.navigateTo({
              url: '../../pages/readintro/readintro?data=' + encodeURIComponent(data),
            });

          }

        }
      })

    },
    delClick(e){
      let ActiveId = e.currentTarget.dataset.id;
      let that = this
      wx.getStorage({
        key:'myloveList',
        success(res){
          let arr = JSON.parse(res.data);
          let newArr = arr.filter((item)=>{
            return item != ActiveId

          });
          wx.setStorage({
            key:'myloveList',
            data:JSON.stringify(newArr)

          });
          that.triggerEvent('changes',newArr)
         

        }
      })


    }

  }
})
